<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/resources/template/template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:ez="http://java.sun.com/jsf/composite/ezcomp"
                xmlns:pe="http://primefaces.org/ui/extensions">


    <ui:define name="content">

        <h:panelGroup rendered="true" >
            <h:form>
                <p:panel id="reportPrint" styleClass="noBorder summeryBorder" header="GRN Summary by Supplier">


                    <p:panelGrid columns="2" style="noPrintButton">
                        <h:outputLabel value="From Date"/>
                        <p:calendar id="frmDate" value="#{commonReport.fromDate}" navigator="true"  pattern="dd MMMM yyyy HH:mm:ss" >
                        </p:calendar>

                        <h:outputLabel value="To Date"/>
                        <p:calendar id="toDate" value="#{commonReport.toDate}" navigator="true" pattern="dd MMMM yyyy HH:mm:ss" >
                        </p:calendar>

                        <h:outputLabel  value="Department"  ></h:outputLabel>
                        <p:autoComplete  value="#{commonReport.department}"  
                                         completeMethod="#{departmentController.completeDept}" var="dept"
                                         itemValue="#{dept}" itemLabel="#{dept.name}" 
                                         forceSelection="true" rendered="true"
                                         requiredMessage="You must select a department" >
                        </p:autoComplete>

                        <h:outputLabel  value="Supplier"  ></h:outputLabel>
                        <p:autoComplete converter="deal" 
                                        value="#{commonReport.institution}"
                                        completeMethod="#{dealerController.completeDealor}"
                                         forceSelection="true" rendered="true"
                                        var="vt" itemLabel="#{vt.name}" itemValue="#{vt}" />
                        
                        <h:outputLabel value="Reference Institution"/>
                        <p:autoComplete converter="institutionConverter" value="#{commonReport.referenceInstitution}"
                                        completeMethod="#{institutionController.completeCompany}" 
                                        forceSelection="true"
                                        var="vt" itemLabel="#{vt.name}" itemValue="#{vt}" />

                        <p:defaultCommand target="btnRefresh"/>

                    </p:panelGrid>
                    
                    <h:panelGrid columns="3">
                        <p:commandButton id="btnRefresh" ajax="false" value="Fill" 
                                         styleClass="noPrintButton" 
                                        actionListener="#{commonReport.createGrnDetailTableByDealor()}"
                                         style="float: right;" /> 
                        
                        <p:commandButton actionListener="#{commonReport.createGrnDetailTableByDealor()}" ajax="false" value="Excel" styleClass="noPrintButton" style="float: right;" >
                                <pe:exporter type="xlsx" target="billed,cancelled,refunded,returnCancelled,sum," fileName="report_grn_detail_by_supplier"  />
                            </p:commandButton>

                        <p:commandButton ajax="false" value="Print" styleClass="noPrintButton" 
                                         style="float: right;" >
                            <p:printer target="reportPrint"/>
                        </p:commandButton>
                    </h:panelGrid>


                    <p:dataTable id="billed"  value="#{commonReport.grnBilled.bills}" var="b" 
                                 rendered="#{commonReport.grnBilled.bills.size()!=0}" 
                                 sortBy="#{b.billType}"  >

                        <f:facet name="header"> 
                            <h:outputLabel value="From" />
                            <h:outputLabel  value="#{commonReport.fromDate}" >
                                <f:convertDateTime pattern="dd MM yyyy HH:mm a"/>
                            </h:outputLabel>                          
                            <h:outputLabel value="To"/>
                            <h:outputLabel  value="#{commonReport.toDate}" >
                                <f:convertDateTime pattern="dd MM yyyy HH:mm a"/>
                            </h:outputLabel>
                            <h:outputLabel value="GRN by - #{commonReport.department.name}"/> 
                            &#13;&nbsp;
                            <h:outputLabel value="GRN"/>
                        </f:facet>

                        <p:column headerText="GRN No" >
                            <f:facet name="header">  
                                <h:outputLabel value="GRN No"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.deptId}"/>
                        </p:column>

                        <p:column headerText="Invoice No" >
                            <f:facet name="header">  
                                <h:outputLabel value="Invoice No"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.invoiceNumber}"/>
                        </p:column>
                        
                        <p:column headerText="Referenace Institution" >
                            <f:facet name="header">  
                                <h:outputLabel value="Referenace Institution"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.referenceInstitution.name}"/>
                        </p:column>
                        
                        <p:column headerText="Created At"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Created At"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.createdAt}" >
                                <f:convertDateTime pattern="dd MM yy hh:mm:ss a"/>
                            </h:outputLabel>
                        </p:column>

                        <p:column headerText="Suplier Name"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Suplier Name"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.fromInstitution.name}"/>

                        </p:column>

                        <p:column headerText="Po No" >
                            <f:facet name="header">  
                                <h:outputLabel value="Po No"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.referenceBill.deptId}"/>
                        </p:column>

                        <p:column headerText="Purchase Value Cash" style=" text-align: right"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Purchase Value Cash"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Cash'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Cash'}" value="0.00" />
                        </p:column>

                        <p:column headerText="Purchase Value Credit" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Purchase Value Credit"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Credit'}" value="#{b.netTotal}"  >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Credit'}" value="0.00"/>
                        </p:column>
                        
                        <p:column headerText="Sale Value Cash" style=" text-align: right"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Sale Value Cash"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Cash'}" value="#{b.saleValue}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Cash'}" value="0.00" />
                        </p:column>

                        <p:column headerText="Sale Value Credit" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Sale Value Credit"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Credit'}" value="#{b.saleValue}"  >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Credit'}" value="0.00"/>
                        </p:column>
                        
                        <p:column headerText="Remark" >
                            <f:facet name="header">  
                                <h:outputLabel value="Remark"/>
                            </f:facet> 
                            <h:outputLabel value="Cancelled. (#{b.cancelledBill.deptId})" rendered="#{b.cancelled==true}" ></h:outputLabel>
                        </p:column>

                        <p:columnGroup type="footer">  
                            <p:row >  
                                <p:column colspan="6" style="text-align:left" footerText="Totals:"/>

                                <p:column style="text-align: right;" footerText="#{commonReport.grnBilled.cash}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.grnBilled.cash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>

                                <p:column style="text-align: right;" footerText="#{commonReport.grnBilled.credit}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.grnBilled.credit}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                
                                <p:column style="text-align: right;" footerText="#{commonReport.grnBilled.saleCash}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.grnBilled.saleCash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>

                                <p:column style="text-align: right;" footerText="#{commonReport.grnBilled.saleCredit}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.grnBilled.saleCredit}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                            </p:row>  
                        </p:columnGroup>  

                    </p:dataTable>

                    <p:spacer height="30"/>

                    <p:dataTable id="cancelled"  value="#{commonReport.grnCancelled.bills}" var="b1"  
                                 rendered="#{commonReport.grnCancelled.bills.size()!=0}" >
                        <f:facet name="header">  
                            <h:outputLabel value="Cancelled GRN "/>
                        </f:facet> 

                        <p:column headerText="Cancelled NO" >
                            <f:facet name="header">  
                                <h:outputLabel value="Cancelled NO"/>
                            </f:facet> 
                            <h:outputLabel value="#{b1.deptId}"/>
                        </p:column>

                        <p:column headerText="GRN No" >
                            <f:facet name="header">  
                                <h:outputLabel value="GRN No"/>
                            </f:facet> 
                            <h:outputLabel value="#{b1.billedBill.deptId}" >
                            </h:outputLabel>
                        </p:column>
                        <p:column headerText="Referenace Institution" >
                            <f:facet name="header">  
                                <h:outputLabel value="Referenace Institution"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.referenceInstitution.name}"/>
                        </p:column>
                        <p:column headerText="Cancelled At"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Cancelled At"/>
                            </f:facet> 
                            <h:outputLabel value="#{b1.createdAt}" >
                                <f:convertDateTime pattern="dd MM yy hh:mm:ss a"/>
                            </h:outputLabel>
                        </p:column>

                        <p:column headerText="Comment" >
                            <f:facet name="header">  
                                <h:outputLabel value="Comment"/>
                            </f:facet> 
                            <h:outputLabel value="#{b1.comments}"/>

                        </p:column>

                        <p:column headerText="Purchase Value Cash"  style=" text-align: right"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Cash"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b1.paymentMethod=='Cash'}" value="#{b1.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b1.paymentMethod!='Cash'}" value="0.00"/>
                        </p:column>
                        <p:column headerText="Purchase Value Credit"  style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Credit"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b1.paymentMethod=='Credit'}" value="#{b1.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b1.paymentMethod!='Credit'}" value="0.00"/>

                        </p:column>
                        
                        <p:column headerText="Sale Value Cash"  style=" text-align: right"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Sale Value Cash"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b1.paymentMethod=='Cash'}" value="#{b1.saleValue}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b1.paymentMethod!='Cash'}" value="0.00"/>
                        </p:column>
                        <p:column headerText="Sale Value Credit"  style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Sale Value Credit"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b1.paymentMethod=='Credit'}" value="#{b1.saleValue}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b1.paymentMethod!='Credit'}" value="0.00"/>

                        </p:column>

                        <p:column exportable="false">
                            <p:selectBooleanCheckbox style="border: black 2px solid;"/>
                        </p:column>

                        <p:columnGroup type="footer">  

                            <p:row>  
                                <p:column colspan="4" style="text-align:left" footerText="Totals:">

                                </p:column>
                                <p:column style="text-align: right;" footerText="#{commonReport.grnCancelled.bills}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.grnCancelled.cash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>

                                </p:column>                                                           
                                <p:column style="text-align: right;" footerText="#{commonReport.grnCancelled.credit}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.grnCancelled.credit}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                
                                <p:column style="text-align: right;" footerText="#{commonReport.grnCancelled.bills}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.grnCancelled.saleCash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>

                                </p:column>                                                           
                                <p:column style="text-align: right;" footerText="#{commonReport.grnCancelled.saleCredit}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.grnCancelled.saleCredit}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>

                            </p:row>  

                        </p:columnGroup>  

                    </p:dataTable>

                    <p:spacer height="30"/>


                    <p:dataTable id="refunded"  value="#{commonReport.grnReturn.bills}" var="b" 
                                 rendered="#{commonReport.grnReturn.bills.size()!=0}" 
                                 sortBy="#{b.billType}"  >

                        <f:facet name="header">  
                            <h:outputLabel value="GRN Return"/>
                        </f:facet>

                        <p:column headerText="GRN Return No" >
                            <f:facet name="header">  
                                <h:outputLabel value="GRN No"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.deptId}"/>
                        </p:column>

                        <p:column headerText="GRN No" >
                            <f:facet name="header">  
                                <h:outputLabel value="GRN No"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.referenceBill.deptId}"/>
                        </p:column>
                        <p:column headerText="Referenace Institution" >
                            <f:facet name="header">  
                                <h:outputLabel value="Referenace Institution"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.referenceInstitution.name}"/>
                        </p:column>
                        <p:column headerText="Referenace Institution" >
                            <f:facet name="header">  
                                <h:outputLabel value="Referenace Institution"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.referenceInstitution.name}"/>
                        </p:column>
                        <p:column headerText="Return At"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Created At"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.createdAt}" >
                                <f:convertDateTime pattern="dd MM yy hh:mm:ss a"/>
                            </h:outputLabel>
                        </p:column>

                        <p:column headerText="Suplier Name"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Suplier Name"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.fromInstitution.name}"/>

                        </p:column>

                        <p:column headerText="Purchase Value Cash" style=" text-align: right"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Purchase Value Cash"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Cash'}" value="#{b.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Cash'}" value="0.00" />
                        </p:column>

                        <p:column headerText="Purchase Value Credit" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Purchase Value Credit"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Credit'}" value="#{b.netTotal}"  >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Credit'}" value="0.00"/>
                        </p:column>
                        
                        <p:column headerText="Sale Value Cash" style=" text-align: right"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Sale Value Cash"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Cash'}" value="#{b.saleValue}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Cash'}" value="0.00" />
                        </p:column>

                        <p:column headerText="Sale Value Credit" style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Sale Value Credit"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b.paymentMethod=='Credit'}" value="#{b.saleValue}"  >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b.paymentMethod!='Credit'}" value="0.00"/>
                        </p:column>
                        <p:column headerText="Remark" >
                            <f:facet name="header">  
                                <h:outputLabel value="Remark"/>
                            </f:facet> 
                            <h:outputLabel value="Cancelled. (#{b.cancelledBill.deptId})" rendered="#{b.cancelled==true}" ></h:outputLabel>
                        </p:column>

                        <p:columnGroup type="footer">  
                            <p:row >  
                                <p:column colspan="4" style="text-align:left" footerText="Totals:"/>

                                <p:column style="text-align: right;" footerText="#{commonReport.grnReturn.cash}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.grnReturn.cash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>

                                <p:column style="text-align: right;" footerText="#{commonReport.grnReturn.credit}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.grnReturn.credit}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                
                                <p:column style="text-align: right;" footerText="#{commonReport.grnReturn.saleCash}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.grnReturn.saleCash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>

                                <p:column style="text-align: right;" footerText="#{commonReport.grnReturn.saleCredit}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.grnReturn.saleCredit}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                
                            </p:row>  
                        </p:columnGroup>  

                    </p:dataTable>

                    <p:spacer height="30"/>

                    <p:dataTable id="returnCancelled"  value="#{commonReport.grnReturnCancel.bills}" var="b1"  
                                 rendered="#{commonReport.grnReturnCancel.bills.size()!=0}" >
                        <f:facet name="header">  
                            <h:outputLabel value="Cancelled GRN Return "/>
                        </f:facet> 

                        <p:column headerText="Cancelled NO" >
                            <f:facet name="header">  
                                <h:outputLabel value="Cancelled NO"/>
                            </f:facet> 
                            <h:outputLabel value="#{b1.deptId}"/>
                        </p:column>

                        <p:column headerText="GRN Return No" >
                            <f:facet name="header">  
                                <h:outputLabel value="GRN Return No"/>
                            </f:facet> 
                            <h:outputLabel value="#{b1.billedBill.deptId}" >
                            </h:outputLabel>
                        </p:column>
                        <p:column headerText="Referenace Institution" >
                            <f:facet name="header">  
                                <h:outputLabel value="Referenace Institution"/>
                            </f:facet> 
                            <h:outputLabel value="#{b.referenceInstitution.name}"/>
                        </p:column>
                        <p:column headerText="Cancelled At"   >
                            <f:facet name="header">  
                                <h:outputLabel value="Cancelled At"/>
                            </f:facet> 
                            <h:outputLabel value="#{b1.createdAt}" >
                                <f:convertDateTime pattern="dd MM yy hh:mm:ss a"/>
                            </h:outputLabel>
                        </p:column>

                        <p:column headerText="Comment" >
                            <f:facet name="header">  
                                <h:outputLabel value="Comment"/>
                            </f:facet> 
                            <h:outputLabel value="#{b1.comments}"/>

                        </p:column>

                        <p:column headerText="Purchase Value Cash"  style=" text-align: right"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Purchase Value Cash"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b1.paymentMethod=='Cash'}" value="#{b1.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b1.paymentMethod!='Cash'}" value="0.00"/>
                        </p:column>
                        <p:column headerText="Purchase Value Credit"  style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Purchase Value Credit"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b1.paymentMethod=='Credit'}" value="#{b1.netTotal}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b1.paymentMethod!='Credit'}" value="0.00"/>

                        </p:column>
                        
                        <p:column headerText="Sale Value Cash"  style=" text-align: right"  >
                            <f:facet name="header">  
                                <h:outputLabel value="Sale Value Cash"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b1.paymentMethod=='Cash'}" value="#{b1.saleValue}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b1.paymentMethod!='Cash'}" value="0.00"/>
                        </p:column>
                        <p:column headerText="Sale Value Credit"  style=" text-align: right" >
                            <f:facet name="header">  
                                <h:outputLabel value="Sale Value Credit"/>
                            </f:facet> 
                            <h:outputLabel rendered="#{b1.paymentMethod=='Credit'}" value="#{b1.saleValue}" >
                                <f:convertNumber pattern="#,##0.00"/>
                            </h:outputLabel>
                            <h:outputLabel rendered="#{b1.paymentMethod!='Credit'}" value="0.00"/>

                        </p:column>

                        <p:column exportable="false">
                            <p:selectBooleanCheckbox style="border: black 2px solid;"/>
                        </p:column>

                        <p:columnGroup type="footer">  

                            <p:row>  
                                <p:column colspan="4" style="text-align:left" footerText="Totals:">

                                </p:column>
                                <p:column style="text-align: right;" footerText="#{commonReport.grnReturnCancel.bills}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.grnReturnCancel.cash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>

                                </p:column>                                                           
                                <p:column style="text-align: right;" footerText="#{commonReport.grnReturnCancel.credit}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.grnReturnCancel.credit}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>
                                
                                
                                <p:column style="text-align: right;" footerText="#{commonReport.grnReturnCancel.bills}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.grnReturnCancel.saleCash}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>

                                </p:column>                                                           
                                <p:column style="text-align: right;" footerText="#{commonReport.grnReturnCancel.saleCredit}">
                                    <f:facet name="footer">
                                        <h:outputLabel value="#{commonReport.grnReturnCancel.saleCredit}">
                                            <f:convertNumber pattern="#,##0.00"/>
                                        </h:outputLabel>
                                    </f:facet>
                                </p:column>

                            </p:row>  

                        </p:columnGroup>  

                    </p:dataTable>

                    <p:spacer height="30"/>

                    <p:dataTable id="sum" value="#{commonReport.grnTotal}"  var="i" >
                        <f:facet name="header">
                            Summary
                        </f:facet>
                        <p:column>
                            <h:outputLabel value="#{i.string}"/>
                        </p:column>
                        <p:column style="font-weight: bold;text-align:right;" >
                            <h:outputLabel value="#{i.value}">
                                <f:convertNumber pattern="#,##0.00" />
                            </h:outputLabel>
                        </p:column>
                        
                        <p:column style="font-weight: bold;text-align:right;" >
                            <h:outputLabel value="#{i.value2}">
                                <f:convertNumber pattern="#,##0.00" />
                            </h:outputLabel>
                        </p:column>
                    </p:dataTable>




                </p:panel>
            </h:form>
        </h:panelGroup>
    </ui:define>

</ui:composition>
